﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sunimage.Spjg.BLL;
using Sunimage.Spjg.Web.Helper;

namespace Sunimage.Spjg.Web.Admin
{
    public partial class BulletinAdd : System.Web.UI.Page
    {
        BulletinBl bulletinBl = new BulletinBl();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSaveNewUser_Click(object sender, EventArgs e)
        {
            Common.Bulletin bulletin = new Common.Bulletin();
            bulletin.CreateTime = DateTime.Now;
            bulletin.Title = tbxTitle.Text;
            bulletin.Content = tbxContent.Text;


            try
            {
                bulletinBl.Create(bulletin);
                Response.Redirect("Bulletin.aspx");
            }
            catch (ApplicationException excp)
            {
                //AlertHelper.ShowError("发生错误，请联系系统管理员", this.Page);
                AlertHelper.ShowError(excp.Message, this.Page);
            }
        }

        protected void btnCancelNewCommercer_Click(object sender, EventArgs e)
        {
            Response.Redirect("Bulletin.aspx");
        }
    }
}